package com.wyh.spring.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description: 注解：@RestController，@RequestMapping()
 * User: 王圆豪
 * Date: 2025-05-31
 * Time: 17:59
 */
@RestController
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping("/demo1")
    public String hello1(){
        return "hello demo1~~";
    }

    @RequestMapping(value = "demo2", method = RequestMethod.GET)
    public String hello2(){
        return "hello demo2";
    }

    @RequestMapping(value = "demo3", method = RequestMethod.POST)
    public String hello3(){
        return "hello demo3";
    }

    @RequestMapping(value = "demo4", method = {RequestMethod.GET,RequestMethod.POST})
    public String hello4(){
        return "hello demo4";
    }

    @GetMapping("/demo5")
    public String hello5(){
        return "hello demo5";
    }
}
